package com.xunlai.infra.permission.business.config;

import com.qiniu.storage.UploadManager;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liang
 * @date 8/7/23 7:56 PM
 */
@Configuration
public class QiniuYunConfig {

    @Bean
    public com.qiniu.storage.Configuration qiniuConfig(){
        com.qiniu.storage.Configuration cfg = new com.qiniu.storage.Configuration();
        cfg.resumableUploadAPIVersion = com.qiniu.storage.Configuration.ResumableUploadAPIVersion.V2;
        return cfg;
    }

    @Bean
    public UploadManager uploadManager(com.qiniu.storage.Configuration cfg){
        return new UploadManager(cfg);
    }
}
